Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

complex-engine

Package Overview
Dependencies
Maintainers
1
Versions
49
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

complex-engine

JS Component Entity Framework for Gamedevelopment

  • 6.1.0
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

ComplexJS

ComplexJS is a JS written Component Entity System for HTML5 Gamedevelopment.

It's strong structure enforces you to write seperated code in a very reusable way. This means that you can reuse the components already created in other projects and add them to a new one.

Due to the Component Entity System architecture you are required to do seperation of concern within your code. Also you (should)have more simpler, clearer and more maintainable files.

NOTE complex is just a game engine. It doesn't provide any renderer functionality or game logic.

Installation

Web

<script src="https://unpkg.com/complex-engine@/build/bundle.js"></script>

Now everything is available under the scope cx

Exp: new cx.cxEntity() or cx.Complex.getInstance()

Npm

npm i complex-engine --save

How To

Getting started

API

API Reference

Concept

You can have multiple scenes. Every scene is a scene or a stage in your game. Within this scene the complete World lives. In that world you have all your entities, managers and systems.

System

A system is a class that contains business logic to process the data for an entity.

Exp. If you want to draw a square at the mouse position, you'll have two systems. One that draws the square on the canvas/screen and the other that will update the mouse position in the component.

You can simply create a system that uses the PIXI renderer to draw your sprites or shapes

Component

A component is similar to a store. It holds data that is bound/mapped to a specific entity.

In the example above, we would have a component that will hold four properties. X/Y coordinates and the width and height of the square that have to be drawn.

Entity

An entity is bucket with multiple components. Every entity can have an unlimited amount of components.

Manager

A manager is something like an interface to external stuff.

For our example, we would create a manager that creates eventlistener on the body and then store those mouse position in it's data. A system then consumes those data and writes it to the components. Our manager would be something like a MouseInputManager. The manager only has the x/y coordinates of the mouse

Keywords

FAQs

Package last updated on 11 Apr 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc